package org.example;

import java.io.FileNotFoundException;
import java.io.IOException;
public class HttpServlet {
    private static final String METHOD_GET = "GET";
    private static final String METHOD_POST = "POST";
    public HttpServlet() {
    }
    public void service(MyHttpRequest req, MyHttpResponse resp) throws IOException {
        //判断请求的方式
        String method = req.getMethod();
        if(method.equals(METHOD_GET)){
            doGet(req, resp);
        }else if(method.equals(METHOD_POST)){
            doPost(req, resp);
        }
    }
    public void doGet(MyHttpRequest req, MyHttpResponse resp) throws IOException {

    }
    public void doPost(MyHttpRequest req, MyHttpResponse resp) throws IOException {
    }
}
